package cn.tedu.mapper;

import cn.tedu.pojo.Tag;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface TagMapper {
    @Insert("insert into tb_tags(name,remark,created_time,modified_time) values(#{name},#{remark},#{createdTime},#{modifiedTime})")
    int insert(Tag tag);

    @Select("select * from tb_tags")
    List<Tag> list();

    @Update("update tb_tags set name = #{name},remark = #{remark},modified_time=#{modifiedTime} where id = #{id}")
    int update(Tag tag);

    @Delete("delete from tb_tags where id = #{id}")
    int delete(Long id);
}
